import React from 'react'
import {
    Redirect,
    Switch,
    Route
} from 'react-router-dom'
import Home from 'views/home'
import Category from 'views/category'
import Goods from 'views/goods'
import Mine from 'views/mine'
import ShoppingCart from 'views/shoppingCart'
import LoginComp from 'views/login'
import List from 'views/list'
import Details from 'views/details'
import Pinkage from 'views/pinkage'
import NotFound from 'views/notfound'

const RouterComp = props =>(
    <Switch>
        <Redirect from="/" to = "/home/hot" exact />
        <Route path="/home" component={ Home }/>
        <Route path="/category" component={ Category }/>
        <Route path="/goods" component={ Goods }/>
        <Route path="/mine" component={ Mine }/>
        <Route path="/shoppingCart" component={ ShoppingCart }/>
        <Route path="/login" component={ LoginComp }/>
        <Route path="/pinkage" component={ Pinkage }/>
        <Route path="/list/:id" component={ List }/>
        <Route path="/details/:id" component={ Details }/>
        <Route component={ NotFound }/>
    </Switch>
)

export default RouterComp